﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WEPMlibrary_Model;
using WEPMconnection_DAL;
using PageLibrary1;

namespace WEPMserver_BLL
{
   public  class Project_BLL
    {
       Project_DAL dal = new Project_DAL();
        /// <summary>
        /// 项目显示
        /// </summary>
        /// <returns></returns>
       public Page<Project> ProjectShow(int index, int size)
        {
            Page<Project> list = new Page<Project>();
            list.pageindex = index;
            list.pagesize = size;
            list.dbcount = (int)Math.Ceiling((double)dal.getCount() / size);
            list.dblist = dal.ProjectShow(index, size);
            return list;
        }
        /// <summary>
        /// 新建项目
        /// </summary>
        /// <returns></returns>
        public int ProjectAdd(Project p)
        {
            return dal.ProjectAdd(p);
        }
        /// <summary>
        /// 添加成员
        /// </summary>
        /// <returns></returns>
        public int MemberAdd(Member m)
        {
            return dal.MemberAdd(m);
        }
        /// <summary>
        /// 成员下拉框
        /// </summary>
        /// <returns></returns>
        public List<Member> MemberXiaLa()
        {
            return dal.MemberXiaLa();
        }
        /// <summary>
        /// 新建项目显示
        /// </summary>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        public List<Project> MemberAdd()
        {
            return dal.MemberAdd();
        }
        /// <summary>
        /// 用户显示供项目负责人分配职责
        /// </summary>
        /// <returns></returns>
        public List<UserInfor> UserInforShow()
        {
            return dal.UserInforShow();
        }
        /// <summary>
        /// 添加项目负责人
        /// </summary>
        /// <returns></returns>
        public int AddProjectmen(string Types, int Uid, int Pid)
        {
            return dal.AddProjectmen(Types,Uid,Pid);
        }
    }
}
